<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
    <title>选择产品</title>
    <meta name="decorator" content="blank"/>
    <%@include file="/WEB-INF/views/include/treeview.jsp" %>
        <script type="text/javascript">
    
        var ids="";
        
        var values="";
        
        // 初始化
        $(document).ready(function(){

        });


        
        //
        function collectClick(){
            

            
            $(".check:checked").each(function(){
                

                
                var str=$(this).val();
                
                var att=str.split("|");
                
                ids+=att[0]+",";
                
                values+=att[1]+",";
                
              
            
            });
            
            ids=ids.substring(0,ids.length-1);
            
            values=values.substring(0,values.length-1);
            
            //alert(ids+"|"+values);
            
        }
        
        function page(n,s){
            $("#pageNo").val(n);
            $("#pageSize").val(s);
            $("#searchForm").submit();
            return false;
        }
        function clearAssign(){
            
            //alert(111);
            
            $(".check").attr("checked",false);

        };
    </script>
</head>
<body>
	    <form:form id="searchForm" modelAttribute="searchApiRequest" action="${ctx}/consultation/recommend/productList" method="post" class="breadcrumb form-search">
        <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
        <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>

        <ul class="ul-form">
            <li><label>产品名称：</label>
                <form:input path="itemName" htmlEscape="false" maxlength="20" class="input-medium"/>
            </li>

            <li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
            <li class="clearfix"></li>
        </ul>
	    </form:form>    
        <table id="contentTable" class="table table-striped table-bordered table-condensed">
            <thead>
                <tr>
                    <th>勾选</th>         
                    <th>产品名称</th>           

                </tr>
            </thead>
            <tbody>
                    
                    <c:forEach items="${page.list}" var="product">
                        <tr>                         
                         
                            <td>
                                <input type="checkbox" path="goodsCategoryId" value="${product.goods_id}|${product.goods_name}"  class="check"/>
                            </td>           
                            <td>
                                ${product.goods_name}
                            </td>                       
                        </tr>
                    </c:forEach>                                 
            </tbody>            
        </table> 
        <div class="pagination">${page}</div>                
</body>
</html>
